package com.tedu._08aop.demo;

import org.springframework.stereotype.Component;

@Component
public class CalculatorImpl implements Calculator{
    @Override
    public int add(int a, int b) {
        System.out.println("开始调用add  int方法");
        int result =a+b;
        System.out.println("add  int方法调用完毕");
        return result;
    }

    @Override
    public double add(double a, double b) {
        System.out.println("开始调用add  double方法");
        double result =a+b;
        System.out.println("add  double方法调用完毕");
        return result;
    }

    @Override
    public int sub(int a, int b) {
        System.out.println("开始调用sub方法");
        int ruslt = a-b;
        System.out.println("sub方法调用完毕");
        return ruslt;
    }

    @Override
    public int mul(int a, int b) {
        System.out.println("开始调用mul方法");
        int ruslt = a*b;
        System.out.println("mul方法调用完毕");
        return ruslt;
    }

    @Override
    public int div(int a, int b) {
        System.out.println("开始调用div方法");
        int ruslt = a/b;
        System.out.println("div方法调用完毕");
        return ruslt;
    }
}
